version: '2'
services:
  base:
    build: 
      context: ./base
    image: {{ registry_dns }}:5000/ppc64le/centos_base
{% for item in ['postgres' ] %}
  {{ item }}:
    build: 
      context: ./{{ item }}
    image: {{ registry_dns }}:5000/ppc64le/{{ item }}:{{ image_version }}
    depends_on:
      - base

{% endfor %}
# need args
{% for item in ['beat', 'etcd', 'rm', 'redis'] %}
  {{ item }}:
    build: 
      context: ./{{ item }}
      args: 
        FILESERVER: {{ package_url }}
    image: {{ registry_dns }}:5000/ppc64le/{{ item }}:{{ image_version }}
    depends_on:
      - base
{% endfor %}

  portal:
    build: 
      context: ./portal
      args: 
        FILESERVER: {{ package_url }}
        PORTAL_TAR: {{ portal_tar }}
    image: {{ registry_dns }}:5000/ppc64le/portal:{{ image_version }}
    depends_on:
      - base
